<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  // const reg1 = /a/;
  // const reg3 = /a/;
  // const reg4 = reg1;
  // const reg2 = new RegExp("a");

  // console.log(reg1 === reg2)
  // console.log(reg1 === reg3)
  // console.log(reg1 === reg4)

  // console.log(reg1)
  // console.log(reg2)
  // console.log(typeof reg1)
  // console.log(typeof reg2)


  let str = "hello";

  const reg1 = /str/;
  console.log(reg1);
  
  const reg2 = new RegExp( str );
  console.log(reg2);



</script>
</html>